import request from '@/utils/request'
//此处用户登录相关的所有axios请求
//1:获取图形验证码
export const getPicCode = () => {
    //返回的数据
    return request({
        method: 'get',
        url: '/captcha/image'
    })
    // return request.get('/captcha/image')
}

//2:获取短信验证码
export const getMsgCode = (captchaCode, captchaKey, mobile) => {
    return request({
        method: 'post',
        url: '/captcha/sendSmsCaptcha',
        data: {
            form: {
                captchaCode: captchaCode,
                captchaKey: captchaKey,
                mobile: mobile
            }
        }
    })
}

//3:登录接口
export const codeLogin = (mobile,smsCode) => {
    return request({
        method: 'post',
        url: '/passport/login',
        headers:{
            platform:'H5'
        },
        data: {
            form: {
                isParty: false,//是否是三方登录
                partyData: {},
                mobile:mobile,//手机号
                smsCode:smsCode//短信验证码
            }
        }
    })
}